package com.xnyzc.lhy.mis.service.impl.cms.order;

import com.xnyzc.lhy.common.penum.cms.EVehicleType;

/**
 * express	经济型
 * compact	舒适型
 * premium	商务型
 */
public enum ETongChengRideType {

    express(0, "经济型"),
    compact(1, "舒适性"),
    premium(2, "商务型"),
    luxury(3, "豪华型");

    private Integer value;
    private String desc;

    ETongChengRideType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 查询运力类型
     *
     * @param id
     * @return
     */
    public static ETongChengRideType getById(Integer id) {
        if (id == null) {
            return express;
        }
        switch (id) {
            default:
                return express;
            case 1:
                return compact;
            case 2:
                return premium;
            case 3:
                return luxury;
        }
    }

    /**
     * 查询运力类型
     *
     * @param name
     * @return
     */
    public static ETongChengRideType getByName(String name) {
        switch (name) {
            default:
                return ETongChengRideType.express;
            case "compact":
                return ETongChengRideType.compact;
            case "luxury":
                return ETongChengRideType.luxury;
            case "premium":
                return ETongChengRideType.premium;
        }
    }

    public static EVehicleType getByType(int type) {
        switch (type) {
            case 0: {
                return EVehicleType.vehTypeEconomic;
            }
            case 1: {
                return EVehicleType.vehTypeComfortable;
            }
            case 2: {
                return EVehicleType.vehTypeBusiness;
            }
            case 3: {
                return EVehicleType.vehTypeLuxury;
            }
        }
        return null;
    }
}
